import { contextBridge, ipcRenderer, desktopCapturer,screen } from "electron";
// const electron = require('electron');
// const ipcRenderer = electron.ipcRenderer;
// const dialog = remote.dialog;
// const BrowserWindow = remote.BrowserWindow

contextBridge.exposeInMainWorld("electronAPI", {
	ipcRenderer,

	// WebRTC
	// 获取共享屏幕时的窗口信息
	// navigatorShare: (type) => desktopCapturer.getSources({ types: type }),
    navigatorShare: () => ipcRenderer.invoke('navigatorShare'),
    // 打开webrtc
    openWebrtc: () => ipcRenderer.send('createWebrtcWindow')
});
